package cn.han.oop;

//本类用于练习面向对象2
public class TestTeacher {
    public static void main(String[] args) {
//1.创建老师类对象t1，所授科目为CGB，姓名为泡泡
        //2.创建老师对象t2，工号为13089.所处部门为Java教研部二部
        //3.创建老师类对象t3，工号为10086，部门为Java教研部一部所授课目为SCD
        Teacher t1 = new Teacher();
        t1.setName("泡泡");
        t1.setSub("CGB");
        System.out.println(t1.getName());
        System.out.println(t1.getSub());
        Teacher t2 = new Teacher();
        t2.setId(13089);
        t2.getId();
        t2.setDepartment("教研二部");
        System.out.println(t2.getDepartment());
        Teacher t3 = new Teacher();
        t3.setId(10086);
        t3.setDepartment("教研一部");
        t3.setSub("SCD");
        System.out.println(t3.getId());
        System.out.println(t3.getSub());
        System.out.println(t3.getDepartment());
    }
}

//1.定义老师类
//1.1属性：姓名 工号 部门 所授课目
//1.2功能：备课 授课
class Teacher {
    //1.1定义成员变量
    private String name;//姓名
    private int id;//工号
    private String sub;
    private String department;

    //1.2提供功能
    public void ready() {
        System.out.println("正在备课中");
    }

    public void teach() {
        System.out.println("正在授课中");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSub() {
        return sub;
    }

    public void setSub(String sub) {
        this.sub = sub;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }
}